<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>vue</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <button v-show="isPage1" v-on:click="up"><</button>
        <img v-bind:src="'img/' + page +'.jpeg'" width="200px">
        <button v-show="isPage2" @click="next">></button>
    </div>


    <script>
        var app = new Vue({
            el:"#app",
            data:{
                page:1,
                isPage1:false,
                isPage2:true,
                imageSrc:"img/"
            },
            methods:{
                up:function () {
                    this.page--;
                    if (this.page <= 1){
                        this.isPage1=false;
                    }
                    this.isPage2=true;
                },
                next:function () {
                    this.page++;
                    if(this.page >=3){
                        this.isPage2=false;
                    }
                    this.isPage1 = true;
                }
            }
        })
    </script>
</body>
</html>